function view=readView(path,filename)
pFile = fopen([ path '/' filename]);
if pFile == -1
    fprintf('can not open file %s',[path '/' filename]);
    return;
end


% pluginVersion
version = str2num(fgetl(pFile));
fclose(pFile);
if version == 5
    view = readView_ver_0005(path,filename);
    return
elseif version ==4
    view = readView_ver_0004(path,filename);
    return;
else
fprintf(' can not read version %d, need version before 0005', version);

view.P = zeros(12,1);
view.width = 0;
view.height = 0;
view.pan = 0;
view.tilt = 0;
view.roll = 0;
view.scale = 0;
view.dx = 0;
view.dy = 0;
view.eye = 0;
view.cam_dir = 0;
return;
end